package com.spic.system.api.factory;

import com.spic.common.core.domain.R;
import com.spic.system.api.RemoteStatus;
import com.spic.system.api.domain.BusinessStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

public class RemoteStatusFallbackFactory implements FallbackFactory<RemoteStatus> {
    private static final Logger log = LoggerFactory.getLogger(RemoteStatusFallbackFactory.class);


    @Override
    public RemoteStatus create(Throwable cause) {
        return new RemoteStatus() {
            @Override
            public R<List<BusinessStatus>> getStateBybusinessType(String businessType) {
                return  R.fail("获取流程状态失败");
            }

            @Override
            public R<List<BusinessStatus>> getStateBybusinessIds(String businessType, List<String> keys) {
                return  R.fail("获取流程状态失败");
            }

            @Override
            public R<List<String>> getTaskInfoList(List<String> list) {
                return  R.fail("获取流程任务当前节点key信息失败");
            }
        };
    }


}
